package edu.nf.dao.impl;

import org.nf.beans.annotation.Component;
import org.nf.dbhelper.SQLExecutor;
import org.nf.dbhelper.handler.BeanListHandler;
import org.stusys.dao.FindAllClassInfoDao;
import org.stusys.model.ClassInfo;
import org.stusys.utils.DBUtil;

import java.util.List;

@Component("findAllClassInfoDao")
public class FindAllClassInfoDaoImpl implements FindAllClassInfoDao {
    @Override
    public List<ClassInfo> findAllClassInfo() {
        String sql = "SELECT * FROM CLASS_INFO WHERE STATUS = 1";
        SQLExecutor se = new SQLExecutor(DBUtil.getConnection());
        BeanListHandler handler = new BeanListHandler(ClassInfo.class);
        return se.executeQuery(sql, handler);
    }
}
